import axios from '../libs/api.request'

// 查询角色列表数据
export function queryRoleListData (params) {
  return axios.request({
    url: '/ids/security/role/page.json',
    params: params
  })
}

// 查询权限tree
export function queryAuthyTree () {
  return axios.request({
    url: '/ids/security/menu/list/tree.json'
  })
}

// 添加角色
export function addRole (params) {
  return axios.request({
    method: 'POST',
    url: '/ids/security/role/add.json',
    data: params
  })
}

// 获取角色详情
export function queryRoleInfo (roleCode) {
  return axios.request({
    url: `/ids/security/role/detail.json?roleCode=${roleCode}`
  })
}

// 修改角色提交
export function editRole (params) {
  return axios.request({
    method: 'PUT',
    url: '/ids/security/role/edit.json',
    data: params
  })
}

export function deleteRole (roleCode) {
  return axios.request({
    method: 'DELETE',
    url: `/ids/security/role/remove.json?roleCode=${roleCode}`
  })
}
